<?php

class PropertyMetaData
{
    private $attributes;
    private $displayName;
    private $description;
    private $propertyName;
    private $name;
    private $container;
    private $validationResult;

    /**
     *
     * @param object $container
     * @param string $propertyName
     * @param string $name
     * @param string $attributes
     */
    public function __construct($container, $propertyName, $name, $attributes)
    {
        $this->container = $container;
        $this->propertyName = $propertyName;
        $this->name = $name;

        if ($attributes != null) {
            foreach ($attributes as $attribute) {
                if ($attribute instanceof DisplayNameAttribute) {
                    $this->displayName = $attribute->getDisplayName();
                } else if ($attribute instanceof DescriptionAttribute) {
                    $this->description = $attribute->getDescription();
                }
            }
        }
        $this->attributes = $attributes;
    }

    /**
     *
     * @return array
     */
    public function getAttributes()
    {
        return $this->attributes;
    }

    /**
     *
     * @return string
     */
    public function getPropertyName()
    {
        return $this->propertyName;
    }

    /**
     *
     * @return object
     */
    public function getContainer()
    {
        return $this->container;
    }

    /**
     *
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     *
     * @return string
     */
    public function getDisplayName()
    {
        return $this->displayName;
    }

    /**
     *
     * @return string
     */
    public function getDescription()
    {
        return $this->description;
    }

    /**
     *
     * @return ValidationResult
     */
    public function getValidationResult()
    {
        return $this->validationResult;
    }

    /**
     *
     * @param ValidationResult $validationResult
     */
    public function setValidationResult(ValidationResult $validationResult)
    {
        $this->validationResult = $validationResult;
    }
}